﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ProgramList.aspx.cs" Inherits="AB.ServiceDirectory.Design.Programs.ProgramList" %>

<%@ Import Namespace="AB.ServiceDirectory" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentTitle" runat="server">
    <h2>
        PROGRAM LIST</h2>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Content" runat="server">
    <asp:UpdatePanel ID="UpdatePanelProgramList" runat="server">
        <ContentTemplate>
            <div class="grid740 simplebox">
                <div class="titleh">
                    <h3 class="sorting_range">
                        <asp:LinkButton ID="linkButtonAll" CommandName="all" OnCommand="FilterByLetters_Command"
                            runat="server">All</asp:LinkButton>
                        <asp:LinkButton ID="linkButton09" CommandName="09" OnCommand="FilterByLetters_Command"
                            runat="server">0-9</asp:LinkButton>
                        <asp:LinkButton ID="linkButtonAE" CommandName="ae" OnCommand="FilterByLetters_Command"
                            runat="server">A B C D E</asp:LinkButton>
                        <asp:LinkButton ID="linkButtonFJ" CommandName="fj" OnCommand="FilterByLetters_Command"
                            runat="server">F G H I J</asp:LinkButton>
                        <asp:LinkButton ID="linkButtonKN" CommandName="kn" OnCommand="FilterByLetters_Command"
                            runat="server">K L M N </asp:LinkButton>
                        <asp:LinkButton ID="linkButtonOR" CommandName="or" OnCommand="FilterByLetters_Command"
                            runat="server">O P Q R</asp:LinkButton>
                        <asp:LinkButton ID="linkButtonSV" CommandName="sv" OnCommand="FilterByLetters_Command"
                            runat="server">S T U V</asp:LinkButton>
                        <asp:LinkButton ID="linkButtonWZ" CommandName="wz" OnCommand="FilterByLetters_Command"
                            runat="server">W X Y Z</asp:LinkButton>
                        <span class="right">
                            <asp:LinkButton ID="CreateButton" runat="server" CssClass="hg-blue" OnClick="CreateButton_Click"
                                Text="CREATE">
                            </asp:LinkButton>
                            &nbsp;
                            <asp:CheckBox ID="CheckBoxInactive" runat="server" Text="Include In-active" AutoPostBack="True"
                                OnCheckedChanged="CheckBoxInactive_CheckedChanged" />
                        </span>
                    </h3>
                </div>
                <asp:GridView ID="GridViewProgram" CssClass="tablesorter" runat="server" AutoGenerateColumns="False"
                    AllowPaging="true" AllowSorting="true" DataSourceID="ObjectDataSourceProgram">
                    <Columns>
                        <asp:HyperLinkField DataTextField="ProgramName" HeaderText="Program Name" DataNavigateUrlFields="ProgramId"
                            DataNavigateUrlFormatString="EditProgram.aspx?programId={0}" SortExpression="ProgramName">
                            <HeaderStyle CssClass="header" />
                        </asp:HyperLinkField>
                        <asp:TemplateField HeaderText="Description" SortExpression="Description">
                            <ItemTemplate>
                                <%# StringTools.Substring(Eval("Description"), 0, 40, true) %>
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Contact" SortExpression="ContactName">
                            <ItemTemplate>
                                <%# Eval("Contact.Surname") %>
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Is Active" SortExpression="IsActive">
                            <ItemTemplate>
                                <%# (bool) Eval("IsActive") ? "Yes" : "No" %>
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" />
                        </asp:TemplateField>
                    </Columns>
                    <PagerStyle CssClass="pagination_table"></PagerStyle>
                </asp:GridView>
                <asp:ObjectDataSource ID="ObjectDataSourceProgram" runat="server" SelectMethod="GetProgramList"
                    TypeName="AB.ServiceDirectory.BO.ProgramBO" EnablePaging="true" SelectCountMethod="GetListCount"
                    StartRowIndexParameterName="startRowIndex" MaximumRowsParameterName="maxRows"
                    SortParameterName="sortType" OnSelecting="ObjectDataSourceProgram_Selecting">
                    <SelectParameters>
                        <asp:Parameter Name="filter" Type="Object" ConvertEmptyStringToNull="False" />
                    </SelectParameters>
                </asp:ObjectDataSource>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
